< Prev(J) / Next(K) > / View :

Filename: /text/sbasic/shared/03120403.xhp

(section: strcomp) (bookmark: bm_id3156027)
StrComp function

StrComp 関数

StrComp Function [Runtime]
StrComp 関数 [関数](hd_id3156027.1)

Compares two strings and returns an integer value that represents the result of the comparison.
2 つの文字列を比較して、その結果を示す数値を返します。(par_id3155805.2)

(/section: strcomp)

Syntax:
構文:(hd_id3153345.3)

StrComp (Text1 As String, Text2 As String[, Compare])
StrComp (Text1 As String, Text2 As String[, Compare])(par_id3150503.4)

Return value:
戻り値:(hd_id3147574.5)

Integer
整数(par_id3156152.6)

Parameter:
パラメータ:(hd_id3150984.7)

Text1: Any string expression
Text1: 任意の文字列表式。(par_id3153061.8)

Text2: Any string expression
Text2: 任意の文字列表式。(par_id3147560.9)

Compare: This optional parameter sets the comparison method. If Compare = 1, the string comparison is case-sensitive. If Compare = 0, no distinction is made between uppercase and lowercase letters.
Compare: 比較モードを指定する数値表式 (省略可)。Compare に 1 を指定すると、大文字と小文字を区別した比較が行われます。Compare に 0 を指定すると、大文字と小文字を区別せずに比較が行われます。(par_id3146796.10)

Return value
戻り値(hd_id3154940.13)

(embed text/sbasic/shared/00000003.xhp#errorcode : linkinfo)

Error Codes

エラーコード(hd_id3152869.37)

(/embed text/sbasic/shared/00000003.xhp#errorcode)

(embed text/sbasic/shared/00000003.xhp#err5 : linkinfo)

5 Invalid procedure call
5 無効なプロシージャー呼び出しです (par_id3150891.41)

(/embed text/sbasic/shared/00000003.xhp#err5)

Example:
例:(hd_id3153968.18)

Sub ExampleStrComp
Sub ExampleStrComp(par_id3151381.19)

Dim iVar As Single
Dim iVar As Single(par_id3154685.20)

Dim sVar As String
Dim sVar As String(par_id3148453.21)

iVar = 123.123
iVar = 123.123(par_id3153369.22)

sVar = Str$(iVar)
sVar = Str$(iVar)(par_id3145786.23)

Msgbox strcomp(sVar , Str$(iVar),1)
Msgbox strcomp(sVar , Str$(iVar),1)(par_id3146975.24)

end sub
end sub(par_id3150487.25)


< Prev / Next >